package com.mipo.springmvc.maximum.shiro.service.impl;

import java.util.HashSet;
import java.util.Set;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mipo.springmvc.maximum.shiro.dao.UserDao;
import com.mipo.springmvc.maximum.shiro.model.User;
import com.mipo.springmvc.maximum.shiro.service.UserService;


@Service("userService")
public class UserServiceImpl implements UserService{

    @Autowired
    private UserDao userDao;

    @Override
	public User getByUsername(String username) {
    	User user = new User();
    	user.setId(1001);
    	user.setUsername("lijie_test");
    	user.setPassword("123456");
    	return user;
		//return userDao.getByUsername(username);
	}

    @Override
    public Set<String> getRoles(String username) {
    	Set<String> roles = new HashSet<String>();
    	roles.add("teacher");
    	return roles;
    	//return userDao.getRoles(username);
    }
    
    @Override
    public Set<String> getPermissions(String username) {
    	Set<String> permissions = new HashSet<String>();
    	permissions.add("user:create");
    	return permissions;
    	//return userDao.getPermissions(username);
    }

}